<#--提示框-->
<link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
<script src="/js/plugins/dialog2/dialog.min.js"></script>
<script src="/js/system/ytr_common.js"></script>

<div class="lww_header">
    <div class="header_wrap" style="width: 1070px;">
        <div class="header_logo">
            <a href="/" class="lww_logo"></a>
        </div>
        <ul class="header_nav">
            <li name="index"><a href="/">首页</a></li>
            <li  name="destination"><a href="/destination">目的地</a></li>
            <li  name="strategy" ><a href="/strategy">旅游攻略</a></li>
            <li  name="travel" ><a href="/travel">旅游日记</a></li>
            <li  name=""><a href="javascript:;">去旅行<i class="icon_caret_down"></i></a></li>
            <li name=""><a href="javascript:;">社区<i class="icon_caret_down"></i></a></li>
        </ul>

        <#--搜索框-->
        <div class="header_search">
            <input type="text" id="search_input"/>
            <a class="icon_search"></a>
        </div>

        <#if userInfo??>
        <div class="login_info">
            <div class="head_user">
                <a href="/mine/home">
                    <img src="${(userInfo.headImgUrl)!'/images/default.jpg'}" />
                    <i class="icon_caret_down"></i>
                </a>
            </div>
            <div class="header_msg">
                消息<i class="icon_caret_down"></i>
            </div>
            <div class="header_daka">
                <a href="javascript:;">打卡</a>
            </div>
            <div class="header_daka" style="margin-right: 5px;">
                <a href="javascript:;" id="userLogout">注销</a>
            </div>
        </div>
        <#else>
        <div class="login-out" >
            <span style="color: orange"> ヾ(✿ﾟ▽ﾟ)ノ &nbsp;</span>
            <#--<a class="weibo-login" href="#" title="微博登录" rel="nofollow"></a>-->
            <a class="qq-login" href="javascript:;" title="QQ登录" rel="nofollow"></a>
            <a class="weixin-login" href="javascript:;" title="微信登录" rel="nofollow"></a>
            <a id="_j_showlogin" title="登录骡窝窝" href="/login.html" rel="nofollow">登录</a>
                <span class="split">|</span>
            <a href="/regist.html" title="注册帐号" rel="nofollow">注册</a>
        </div>
        </#if>
    </div>
    <div class="shadow"></div>
</div>


<script>
    $(function () {
        //注销按钮绑定事件
        $('#userLogout').on('click', function () {
           $.get('/userLogout', function (data) {
               checkData(data, 1000, "注销成功");
           })
        });

        //QQ按钮绑定事件
        $('.qq-login').on('click', function () {
            window.location.href = 'https://graph.qq.com/oauth2.0/show?' +
                    'which=Login&display=pc&response_type=code&client_id=101397212&' +
                    'redirect_uri=http://unic.nat300.top/qqcallback&state=state';
        });

        //微信按钮绑定事件
        $('.weixin-login').on('click', function () {
            //跳转到微信扫码页面
            window.location.href = '/wxLoginGetCode';
        });

        //搜索框
        $('.icon_search').on('click', function () {
           var input = $('#search_input').val();
            console.log(input);
            window.location.href="/q?type=-1&keyword=" + input;
        });

    });
</script>

<script>
    $("li[name=${currentNav}]").addClass("header_nav_active");
</script>